package org.example.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.mongodb.core.mapping.MongoId;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @TableName account
 */
@TableName(value ="account")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Account implements Serializable {
    @MongoId
    @TableId
    private Long id;

    private String phone;

    private String userName;

    private Integer integral;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Account(Long id, String userName) {
        this.id = id;
        this.userName = userName;
    }
}